package view;

import javax.swing.JPanel;
import javax.swing.JLabel;
import java.awt.Color;
import java.awt.Dimension;
import controller.ACSystem;
import model.AuctionCentralEmployee;

import javax.swing.border.LineBorder;

/** 
 * The ACEmployee Pane 
 * @author Bob Landowski
 */
@SuppressWarnings("serial")
public class ACEmployeePane extends JPanel {

	/** The first name */
	private String my_first_name;
	
	/** The last name */
	private String my_last_name;
	
	private JLabel first_Name_Label;

	private JLabel last_Name_Label;

	private JLabel address_1_Label;

	private JLabel address_2_Label;

	private JLabel city_Label;

	private JLabel state_Label;

	private JLabel zip_Label;

	private JLabel phone_Label;

	private JLabel email_Label;
	
	/**
	 * Create the panel.
	 * 
	 * @author Bob Landowski
	 */
	public ACEmployeePane(final ACSystem the_ACcontroller) {
		setBorder(new LineBorder(new Color(0, 0, 0), 5));
		setPreferredSize(new Dimension(500, 500));
		setLayout(null);

		JLabel firstnameLabel = new JLabel("First Name:");
		firstnameLabel.setBounds(15, 46, 85, 20);
		add(firstnameLabel);

		JLabel lastNameLabel = new JLabel("Last Name:");
		lastNameLabel.setBounds(15, 76, 100, 20);
		add(lastNameLabel);

		JLabel address1_label = new JLabel("Address:");
		address1_label.setBounds(15, 106, 69, 20);
		add(address1_label);

		JLabel address_label2 = new JLabel("");
		address_label2.setBounds(15, 136, 69, 20);
		add(address_label2);

		JLabel cityLabel = new JLabel("City:");
		cityLabel.setBounds(15, 166, 47, 20);
		add(cityLabel);

		JLabel stateLabel = new JLabel("State:");
		stateLabel.setBounds(240, 166, 47, 20);
		add(stateLabel);

		JLabel zipCodeLabel = new JLabel("Zip Code:");
		zipCodeLabel.setBounds(15, 196, 69, 20);
		add(zipCodeLabel);

		JLabel phone_label = new JLabel("Phone:");
		phone_label.setBounds(240, 226, 69, 20);
		add(phone_label);

		JLabel email_label = new JLabel("Email:");
		email_label.setBounds(15, 226, 69, 20);
		add(email_label);

		JLabel AuctionCentralEmployeeLabel = new JLabel(
				"Auction Central Employee Screen");
		AuctionCentralEmployeeLabel.setBounds(130, 16, 260, 20);
		add(AuctionCentralEmployeeLabel);

		first_Name_Label = new JLabel(my_first_name);
		first_Name_Label.setBounds(115, 46, 206, 20);
		add(first_Name_Label);

		last_Name_Label = new JLabel(my_last_name);
		last_Name_Label.setBounds(115, 76, 206, 20);
		add(last_Name_Label);

		address_1_Label = new JLabel("");
		address_1_Label.setBounds(115, 106, 206, 20);
		add(address_1_Label);

		address_2_Label = new JLabel("");
		address_2_Label.setBounds(94, 136, 206, 20);
		add(address_2_Label);

		city_Label = new JLabel("");
		city_Label.setBounds(115, 166, 104, 20);
		add(city_Label);

		state_Label = new JLabel("");
		state_Label.setBounds(286, 166, 104, 20);
		add(state_Label);

		zip_Label = new JLabel("");
		zip_Label.setBounds(115, 196, 104, 20);
		add(zip_Label);

		email_Label = new JLabel("");
		email_Label.setBounds(104, 226, 115, 20);
		add(email_Label);

		phone_Label = new JLabel("");
		phone_Label.setBounds(286, 226, 115, 20);
		add(phone_Label);
	}

	/**
	 * The getObjectData method
	 */
	public void getObjectData(Object the_object) {
		AuctionCentralEmployee my_employee = (AuctionCentralEmployee) the_object;
		
		first_Name_Label.setText(my_employee.get_first_name());
		last_Name_Label.setText(my_employee.get_last_name());
		address_1_Label.setText(my_employee.getMy_address().getMy_address1()
				+ " " + my_employee.getMy_address().getMy_apt_num());
		address_2_Label.setText(my_employee.getMy_address().getMy_address2());
		city_Label.setText(my_employee.getMy_address().getMy_city());
		state_Label.setText(my_employee.getMy_address().getMy_state());
		zip_Label.setText(my_employee.getMy_address().getMy_zip());
		email_Label.setText(my_employee.getMy_email());
		phone_Label.setText(my_employee.getMy_phone());

	}
}
